|
|
 |
|
|
|
|
For i = 1 To NumZ
Set pline = New Polyline3d
x1 = Xmin
' Get the starting point. y1 = YValue(x1, Z)
For j = 1 To NumX - 1
For k = 1 To Subdivisions
x2 = x1 + MinorDx
y2 = YValue(x2, Z)
pline.AddSegment x1, y1, Z, x2, y2, Z
y1 = y2
x1 = x2
Next k
Next j
TheGrid.Polylines.Add pline
Z = Z + MajorDz
Next i
End Sub |
|
|
|
|
|
|
|
|
There is one main drawback to the refined grid method. If you look too closely at part of the surface that is changing rapidly, the segments connecting two grid locations may appear to stick up beyond the surface. Figure 14.6 shows this sort of area highlighted. |
|
|
|
|
|
|
|
|
If the surface you want to display is generated from experimental or observed data, you may not have all the values you would like. You may be missing some values in the middle of a region, or you may have data for only a few positions scattered throughout a large area. |
|
|
|
|
|
|
|
|
One way you can display this sort of surface is to estimate the missing values in the grid. To make managing this kind of sparse grid easier, you can create a SparseGrid3d class. This class contains the actual data values, plus a grid object to display a surface approximating those values. You can store the data values in an array of Point3D structures. |
|
|
|
|
|
|
|
|
Figure 14.6
In a refined grid, curves may appear
to stick up above the surface. |
|
|
|
|
|